package persistence;

import persistence.xstream.XmlDatabaseFileList ;

/**
 * definitions for tests, mainly URIs and paths.
 *
 * @author idan
 */
public class Definitions
{
	public static final String TEST_DIRECTORY = "tests/" ;
	public static final String DATA_DIRECTORY = Definitions.TEST_DIRECTORY + "data/" ;
	public static final String INPUT_DIRECTORY = Definitions.TEST_DIRECTORY + "inputs/" ;
	public static final String OUTPUT_DIRECTORY = Definitions.TEST_DIRECTORY + "outputs/" ;

	public static final String DB_DIRECTORY = Definitions.INPUT_DIRECTORY + "db/" ;

	public static final String MEMBER_URI = Definitions.DB_DIRECTORY + "users.xml" ;
	public static final String DIRECTORY_URI = Definitions.DB_DIRECTORY + "directories.xml" ;
	public static final String THREAD_URI = Definitions.DB_DIRECTORY + "threads.xml" ;
	public static final String POST_URI = Definitions.DB_DIRECTORY + "posts.xml" ;
	public static final String INDEX_URI = Definitions.DB_DIRECTORY + "index.xml" ;
	public static final String LOGINS_URI = Definitions.DB_DIRECTORY + "statistics.xml" ;

	public static XmlDatabaseFileList getXmlFiles()
	{
		XmlDatabaseFileList files = new XmlDatabaseFileList() ;
		files.setMemberFile(Definitions.MEMBER_URI) ;
		files.setDirectoryFile(Definitions.DIRECTORY_URI) ;
		files.setThreadFile(Definitions.THREAD_URI) ;
		files.setPostFile(Definitions.POST_URI) ;
		files.setLoginFile(Definitions.LOGINS_URI) ;
		return files ;
	}

	public static final String makePath(final String baseFolder, final Class testClass)
	{
		return baseFolder + testClass.getName() + "/" ;
	}
}
